#import "OpulentCrispCell.h"


@implementation OpulentCrispCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
	self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
	if (self) {

		self.selectionStyle = UITableViewCellSelectionStyleNone;
		//self.contentView.backgroundColor = UIColor.whiteColor;

		//: 初始化UI布局
		[self magnitudeConfigUI];
	}
	return self;
}

- (void)setArchive:(OpulentCrispModel *)archive {
	_archive = archive;

	//: 配置cell的UI

}
- (UITextView *)universeTextView {
	if (!_universeTextView) {
	
        _universeTextView = [[UITextView alloc] init];
        _universeTextView.frame = CGRectMake(31, 44, 33, 147);
	}
	return _universeTextView;
}

//: 设置hammerResilient的numberOfLines
- (NSInteger)delightful:(NSInteger)wispVortexJoyous {
	NSInteger duskWander = 10;
	if (duskWander != -26 && duskWander > 1362) {

		NSString *yonder = [NSString stringWithFormat:@"img_%ld", (long)duskWander];
		NSData *breezeSuspicionSerene = [yonder dataUsingEncoding:NSUTF8StringEncoding];
		if (breezeSuspicionSerene) return duskWander / 60;

		return duskWander * 13;
	}
	return duskWander - 8;
}

//: _luminousQuicksilverAmazingBtn 的点击事件
- (void)action_3 {}

- (UIButton *)luminousQuicksilverAmazingBtn {
	if (!_luminousQuicksilverAmazingBtn) {
	
        _luminousQuicksilverAmazingBtn = [[UIButton alloc] initWithFrame:CGRectZero];
        _luminousQuicksilverAmazingBtn.frame = CGRectMake(41, 8, 191, 144);
        UIImage *apprehensionZephyrAlchemy = [UIImage imageNamed:@"images/icon_3.png"];
        if (apprehensionZephyrAlchemy) {
	        [_luminousQuicksilverAmazingBtn setImage:apprehensionZephyrAlchemy forState:UIControlStateNormal];
        }
        [_luminousQuicksilverAmazingBtn setTitle:@"button_3" forState:UIControlStateNormal];
        [_luminousQuicksilverAmazingBtn setTitle:@"button_selected_3" forState:UIControlStateSelected];
        [_luminousQuicksilverAmazingBtn setTitleColor:[UIColor colorWithRed:220/255.0 green:64/255.0 blue:61/255.0 alpha:0.5] forState:UIControlStateNormal];
        [_luminousQuicksilverAmazingBtn setTitleColor:[UIColor colorWithRed:52/255.0 green:176/255.0 blue:69/255.0 alpha:0.9] forState:UIControlStateSelected];
        [_luminousQuicksilverAmazingBtn addTarget:self action:@selector(action_3) forControlEvents:UIControlEventTouchUpInside];
	}
	return _luminousQuicksilverAmazingBtn;
}

- (void)magnitudeConfigUI {
	//: 描述_0
	[self.contentView addSubview:self.universeTextView];


    //: 描述_1
    UILabel *hammerResilient = [[UILabel alloc] initWithFrame:CGRectZero];
    hammerResilient.size = CGSizeMake(104, 170);
    hammerResilient.left = 1;
    hammerResilient.top = 11;
    hammerResilient.text = @"label_1";
    hammerResilient.font = [UIFont systemFontOfSize:18 weight:UIFontWeightBold];
    hammerResilient.textColor = [UIColor colorWithRed:159/255.0 green:203/255.0 blue:45/255.0 alpha:0.5];
    hammerResilient.textAlignment = NSTextAlignmentRight;
    //: UILabel的骚操作 充数
    hammerResilient.numberOfLines = [self delightful:2];
    self.flourishLabel = hammerResilient;
    [self.contentView addSubview:hammerResilient];


    //: 描述_2
    self.journeyView = [UIView new];
    self.journeyView.size = CGSizeMake(51, 155);
    self.journeyView.left = 5;
    self.journeyView.top = 41;
    [self.contentView addSubview:self.journeyView];

	//: 描述_3
	[self.contentView addSubview:self.luminousQuicksilverAmazingBtn];


    //: 描述_4
    UIImageView *breeze = [UIImageView new];
    breeze.contentMode = UIViewContentModeScaleAspectFill;
    breeze.clipsToBounds = YES;
    breeze.layer.cornerRadius = 0;
    breeze.layer.masksToBounds = YES;
    UIImage *zealIntrepidSuspicion = [UIImage imageNamed:@"images/image_4.png"];
    if (zealIntrepidSuspicion) {
	    breeze.image = zealIntrepidSuspicion;
    }
    self.velvetImageView = breeze;
    [self.contentView addSubview:breeze];
	[self.velvetImageView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(68);
		make.height.mas_equalTo(63);
		make.top.equalTo(@(16));
		make.bottom.equalTo(@(20));
	}];
}


@end
